return this._trackCoverUrl;
}
+ get app() {
+ return this._app;
+ }
+
playPause() {
this._playerProxy.PlayPauseAsync().catch(logError);
}
raise() {
// The remote Raise() method may run into focus stealing prevention,
// so prefer activating the app via .desktop file if possible
- let app = null;
- if (this._mprisProxy.DesktopEntry) {
- let desktopId = `${this._mprisProxy.DesktopEntry}.desktop`;
- app = Shell.AppSystem.get_default().lookup_app(desktopId);
- }
-
- if (app)
- app.activate();
+ if (this._app)
+ this._app.activate();
else if (this._mprisProxy.CanRaise)
this._mprisProxy.RaiseAsync().catch(logError);
}
this._trackCoverUrl = '';
}
+ if (this._mprisProxy.DesktopEntry) {
+ const desktopId = `${this._mprisProxy.DesktopEntry}.desktop`;
+ this._app = Shell.AppSystem.get_default().lookup_app(desktopId);
+ } else {
+ this._app = null;
+ }
+
this.emit('changed');
let visible = this._playerProxy.CanPlay;